package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author yzq
 * @Description 供应商
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_department")
public class Department implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "科室名称",required = true)
    private String departmentName;
    @ApiModelProperty(value = "状态0：无效，1：正常",required = true)
    private Integer status;
    @ApiModelProperty(value = "科室名称拼音",required = true)
    private String pinyin;
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "所属药房")
    private String createUser;
    @ApiModelProperty(value = "0:公共科室，1药房所属科室")
    private Integer type;

    public void copy(Department source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
